<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <jsp:include page="../../head.jsp"/>
    <title>申请驳回</title>
    <script type="text/javascript">
        var formSetting = {
            title: "申请驳回",
            module: 'save',
            numCount: '1',
            columns: [
                {
                    name: "declaId",
                    label: "报关单id",
                    value: "${declaId}",
                    hidden: true,
                    validate: 'validate[required]',
                },
                {
                    name: "applyReasonId",
                    label: "驳回原因",
                    validate: 'validate[required]',
                    type: "dropdown",
                    dropdownType: "ajax",
                    url: "/api/dictionary/search?dtGroupCode=reject_apply_reason",
                    op: "eq",
                    minLength: 0,
                    success: function (data) {
                        data = data.content;
                        var array = new Array();
                        $.each(data, function (i, n) {
                            array.push([n["dtValue"], n["dtId"]]);
                        });
                        return array;
                    }
                }, {
                    name: "remark",
                    label: "备注",
                    type: "textarea",
                }

            ],
            buttons: {
                custom: []
            },
            form: {
                'url': 'apply',
                'ajaxForm': {
                    success: function (data) {
                        if (data.result) {
                            layer.alert(data.msg, {title: false}, function () {
                                parent.location.reload();
                                window.close();
                            });
                        } else {
                            layer.alert(data.msg);
                        }
                        return false;
                    }
                }
            }

        };
        $(document).ready(function () {
            $("#dataTable").mrdForm(formSetting);
        });
    </script>
</head>
<body>
<div id="dataTable"></div>
</body>
</html>
